\begin{tikzpicture}[>=Stealth,scale=0.8]
    \draw [->] (-5,0) -- (8,0);
    \foreach \x in {-1,...,3} {
        \draw (\x,0.2) -- (\x,0) node[anchor=north] {$\x$};
    }

   \pic [transform shape] {interval={start=1, stop=2, height=0.7}};
   \pic [transform shape] [red] {infinity interval={start=-1, stop=-4.5}};
   \pic [transform shape] [red] {infinity interval={start=3, stop=7.5}};

    \foreach \x in {-1, 1, 2, 3} {
        \draw [fill=white] (\x, 0) circle(0.1);
    }
\end{tikzpicture}
